<%@ page import="java.util.List" %>
<%@ page import="com.example.ordersystem.domain.Comment" %><%--
  Created by IntelliJ IDEA.
  User: 檬zhu
  Date: 2021/12/13
  Time: 23:07
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" %>
<html>
<head>
    <title></title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/layui/css/layui.css">
</head>
<body>
<br>
<jsp:include page="title.jsp"/>
<div class="layui-carousel" id="test10" style="margin-left: 25%">
    <div carousel-item="">
        <div><img src="${pageContext.request.contextPath}/resources/images/feng1.jpg" alt="" style="height: 300px; width: 635px"></div>
        <div><img src="${pageContext.request.contextPath}/resources/images/feng2.jpg" alt="" style="height: 300px;width:  635px"></div>
        <div><img src="${pageContext.request.contextPath}/resources/images/feng3.jpg" alt="" style="height: 300px; width: 635px"></div>
    </div>
</div>

<script src="${pageContext.request.contextPath}/resources/layui/layui.js"></script>
<script type="text/javascript">
    layui.use([ 'carousel', 'form' ], function() {
        var carousel = layui.carousel, form = layui.form;

        //图片轮播
        carousel.render({
            elem : '#test10',
            width : '628px',
            height : '240px',
            interval : 2000,
            autoplay : true
        });
    })
</script>
<%
    @SuppressWarnings("unchecked")
    List<Comment> comments = (List<Comment>) request.getAttribute("comments");
    @SuppressWarnings("unchecked")
    List<Comment.Label> labels = (List<Comment.Label>) request.getAttribute("labels");
    /*店铺平均评分*/
    int average = Integer.parseInt(String.valueOf(request.getAttribute("average")));
%>
<blockquote class="layui-elem-quote layui-quote-nm" style="margin-top:10px;margin-left: 25%;width:595px">
    评价等级：<%=average%>.0分
    <br><br>评价标签：
    <%
        for (Comment.Label label : labels){
    %>
    <button type="button" class="layui-btn layui-btn-primary layui-btn-radius"><%=label.getName()%>：<%=label.getCount()%></button>
    <%
        }
    %>
    <br><br>
    <span class="layui-badge-dot"></span>
    <span class="layui-badge-dot layui-bg-orange"></span>
    <span class="layui-badge-dot layui-bg-green"></span>
    <span class="layui-badge-dot layui-bg-cyan"></span>
    <span class="layui-badge-dot layui-bg-blue"></span>
    <span class="layui-badge-dot layui-bg-black"></span>
    <span class="layui-badge-dot layui-bg-gray"></span>
</blockquote>

<div style="padding: 20px; background-color: #F2F2F2;width: 595px;margin-left: 25%">
    <div class="layui-row layui-col-space15">
        <%
            for (Comment comment :comments){
        %>

        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">顾客：<%=comment.getCustomerNum()%>&nbsp&nbsp&nbsp&nbsp&nbsp评分：<%=comment.getGrade()%>.0分</div>
                <div class="layui-card-body">
                    <p><%=comment.getContent()%></p>
                    <img src="<%=comment.getPicture()%>" alt="" width="70px" height="70px">
                </div>
            </div>
        </div>
        <%
            }
        %>
    </div>
</div>
</body>
</html>
